﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;

namespace TravelexForwardContracts
{
    public partial class ReportForm : Form
    {
        private DataSetCompanyRecords m_dsCompanyRecords;

        public ReportForm()
        {
            InitializeComponent();
        }

        public void setDataSet(DataSetCompanyRecords in_ds)
        {
            m_dsCompanyRecords = (DataSetCompanyRecords)in_ds.Copy();
        }

        private void crystalReportViewer_Load(object sender, EventArgs e)
        {
            if (m_dsCompanyRecords.Tables[0].Rows.Count < 1)
            {
                MessageBox.Show("Nothing to show");
                return;
            }

            CrystalReportCompanyRecords reportDoc = new CrystalReportCompanyRecords();
           // String reportPath = @"..//..//CrystalReportCompanyRecords.rpt";
            reportDoc.SetDataSource(m_dsCompanyRecords);
           // reportDoc.Load(reportPath);
            crystalReportViewer.ReportSource = reportDoc;
            crystalReportViewer.Refresh();
        }
    }
}
